<!-- 客户管理-客户详情-合同记录 -->
<template>
  <div class="contract-record">
    <TableTurn
      :isShowPagination="false"
      ref="tableRef"
      :table-data="getContactData"
      :args="args"
    >
      <a-table-column align="center" :width="80">
        <template #title> 序号 </template>
        <template #cell="{ rowIndex }">
          {{ rowIndex + 1 }}
        </template>
      </a-table-column>
      <a-table-column
        title="合同名称"
        dataIndex="name"
        align="center"
        :width="200"
      >
      </a-table-column>
      <a-table-column
        title="合同编号"
        dataIndex="number"
        align="center"
        :width="200"
      >
      </a-table-column>
      <a-table-column
        title="合同负责人"
        dataIndex="createByName"
        align="center"
        :width="200"
      >
      </a-table-column>
      <!-- <a-table-column
        title="头像"
        dataIndex="avatar"
        align="center"
        :width="120"
      >
        <template #cell="{}">
          <a-avatar :size="70" shape="square">Arco</a-avatar>
        </template>
      </a-table-column>
      <a-table-column
        title="联系电话"
        :width="150"
        dataIndex="phone"
        align="center"
      >
      </a-table-column> -->
      <!-- <a-table-column title="职务" :width="100" dataIndex="job" align="center">
      </a-table-column>
      <a-table-column
        title="部门"
        :width="100"
        dataIndex="department"
        align="center"
      >
      </a-table-column>
      <a-table-column
        title="办公地点"
        :width="300"
        dataIndex="address"
        align="center"
      >
      </a-table-column>
      <a-table-column
        title="决策作用"
        :width="200"
        dataIndex="decision"
        align="center"
      >
      </a-table-column>
      <a-table-column
        :width="150"
        title="是否为首要联系人"
        dataIndex="primaryContact"
        align="center"
        :sortable="{
          sortDirections: ['descend'],
        }"
      >
        <template #cell="{ record }">
          {{ record.primaryContact === '0' ? '否' : '是' }}
        </template>
      </a-table-column>
      <a-table-column
        :width="150"
        title="是否为决策关键人"
        dataIndex="primaryDecision"
        align="center"
        :sortable="{
          sortDirections: ['descend'],
        }"
      >
        <template #cell="{ record }">
          {{ record.primaryDecision === '0' ? '否' : '是' }}
        </template>
      </a-table-column>

      <a-table-column align="center" :width="300" fixed="right" title="操作">
        <template #cell="{ record, rowIndex }">
          <a-button type="text" @click="goEdit(record)">编辑</a-button>
          <a-popconfirm
            @ok="deleteItem(record.id, rowIndex)"
            content="确定删除吗"
            type="error"
          >
            <a-button type="text">删除</a-button>
          </a-popconfirm>
        </template>
      </a-table-column> -->
    </TableTurn>
  </div>
</template>

<script lang="ts" setup>
  import { reactive } from 'vue';
  import { useRoute } from 'vue-router';
  import { useOrderStore } from '@/store';
  import { GetClientDetailTabs } from '@/api/order-management/client-management/client-list';

  const route = useRoute();
  const store = useOrderStore();
  let clientId = Number(route.query.id);

  const getContactData = async () => {
    try {
      const res = await GetClientDetailTabs({
        id: clientId,
        typeId: 6,
        pageData: {
          page: 0,
          size: -1,
        },
      });
      return Promise.resolve(res);
    } catch (err: unknown) {
      console.log(err);
    }
  };
</script>

<style scoped lang="less">
  .contract-record {
    padding: 0 40px;
  }
</style>
